package com.qfmy.model.enums.novel;

/**
 * @author 清风明月
 * @Package com.qfmy.model.enums.novel
 * @date 2025/4/14
 * @description 小说的状态
 */
@SuppressWarnings("all")
public enum BookStatus {
    /**
     * 连载中
     */
    SERIALIZING(0,"连载中"),
    /**
     * 已完结
     */
    FINISHED(1,"已完结"),
    /**
     * 暂停更新
     */
    PAUSED(2,"断更");

    private Integer code;
    private String desc;

    BookStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    /**
     * 根据小说的code获取状态描述
     */
        public static String getDescByCode(Integer code) {
            for (BookStatus bookStatus : BookStatus.values()) {
                if (bookStatus.getCode().equals(code)) {
                    return bookStatus.desc;
                }
            }
            return null;
        }

}
